import Vue from 'vue';
import Router from 'vue-router';

// 主页面
const Main = r => require.ensure([], () => r(require('../views/main/index.vue')), 'Main');
// 测试页面
const Test = r => require.ensure([], () => r(require('../views/test/index.vue')), 'Test');
const Test1 = r => require.ensure([], () => r(require('../views/test1/index.vue')), 'Test1');


Vue.use(Router);

export default new Router({
  routes: [{
    path: '/',
    name: 'Main',
    component: Main,
    children: [{
        path: 'test',
        component: Test,
        name: Test
      },
      {
        path: 'test1',
        component: Test1,
        name: Test1
      },
    ]
  }, ]
});